<template>
    <div>
        <!-- 面包屑 -->
        <el-bread></el-bread>
        <el-button type="primary" plain class="btn" size="small" @click="addDialog">添加</el-button>
        <!-- 列表 -->
        <v-list @edit="edit"></v-list>
        <!-- 弹框 -->
        <v-dialog :addInfo="addInfo" @cancel="cancel" ref="adminRef"></v-dialog>
    </div>
</template>
<script>
import vList from './list.vue'
import vDialog from './dialog.vue'
export default {
    data() {
        return {
            addInfo:{
                isShow:false,
                isAdd:true
            }
        }
    },
    methods: {
        // 点击添加打开弹窗
        addDialog() {
            this.addInfo.isShow=true
            this.addInfo.isAdd=true
        },
        // 关闭弹窗
        cancel(e){
            // console.log(e);
            this.addInfo.isShow=e
        },
        // 编辑弹框
        edit(e){
            this.addInfo.isShow=true
            this.addInfo.isAdd=false
            this.$refs.adminRef.lookUp(e)
        }
    },
    mounted() { },
    watch: {},
    computed: {},
    filters: {},
    components: {
        vList,
        vDialog
    }
}
</script>
<style scoped>
.btn {
    margin: 15px;
}
</style>